import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    allStatus: '总览',
    twoStatus: '',
    showJz: false,
    showDxxr: false,
    showDb: false,
    showYhd: false,
    showHd: false,
    showZm: false,
    showGsp: false,
    showWater: false,
    waterHeight: null,
    videoPlayerInfo: {
      show: false,
    },
    showBzlx: false,
    showYjRight: false,
    mapPoint: {
      list: null,
      show: false,
      type: null
    }
  },
  mutations: {
    changeMapPoint(state, val) {
      state.mapPoint = val
    },
    changeBzlx(state, val) {
      state.showBzlx = val
    },
    changeStatus(state, val) {
      state.allStatus = val
    },
    changeTwoStatus(state, val) {
      state.twoStatus = val
    },
    changeMapJz(state, val) {
      state.showJz = val
    },
    changeMapDxxr(state, val) {
      state.showDxxr = val
    },
    changeMap(state, obj) {
      if (obj.val == '大坝') {
        state.showDb = obj.isShow
      } else if (obj.val == '溢洪道') {
        state.showYhd = obj.isShow
      } else if (obj.val == '涵洞') {
        state.showHd = obj.isShow
      } else if (obj.val == '闸门') {
        state.showZm = obj.isShow
      } else if (obj.val == '界桩') {
        state.showJz = obj.isShow
      } else if (obj.val == '告示牌') {
        state.showGsp = obj.isShow
      }
    },
    getWater(state, obj) {
      state.showWater = obj.isShow
      state.waterHeight = obj.height
    },
    setVideo: (state, newVal) => {
      state.videoPlayerInfo = newVal;
    },
    changeYjRight: (state, newVal) => {
      state.showYjRight = newVal;
    },
  },
  actions: {
  },
  modules: {
  }
})
